package com.xxx.controller;

import com.xxx.feignclient.HystrixClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author blijojo
 * @date 2021/5/24
 */
@RestController
@Slf4j
public class TestController {

    @Resource
    private HystrixClient hystrixClient;


    @GetMapping("/demo")
    public String demo(int id) {
        log.info("调用openfeign-hystrix的demo方法");
        String result = hystrixClient.testBreak(id);
        return "test ok!" + result;
    }

}
